Essential TypeScript by Adam Freeman

Essential TypeScript by Adam Freeman

Author:Adam Freeman
Language: eng
Format: epub, pdf
ISBN: 9781484249796
Publisher: Apress


let data: Person[] = [new Employee("fvega", "Fidel Vega", "Sales", "Paris"),

new Customer("ajones", "Alice Jones", "London", 500)];

data.push(new Supplier("dpeters", "Dora Peters", "New York", "Acme"));

data.forEach(item => console.log(item.getDetails()));

Listing 11-14.Defining an Abstract Class in the index.ts File in the src Folder

Abstract classes are created using the abstract keyword before the class keyword, as shown in Figure 11-4.

Figure 11-4.Defining an abstract class

The abstract keyword is also applied to individual methods, which are defined without a body, as shown in Figure 11-5.

Figure 11-5.Defining an abstract method



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.